<?php
include_once("../../../common/modules/checkA.php");
include_once("../../../../config.php");
include_once("../controller/app-edit.php");
$act = isset($_REQUEST['act']) ? $_REQUEST['act'] : '';

$id = isset($_REQUEST['id']) ? $_REQUEST['id'] : '0';


/* 权限判断 */
admin_priv('wechat');

if($act == 'update'){
	
	$table    = $table_Prefix ."app_wx";

	$detail_list = $_REQUEST;

	$sql=update_date($table,$detail_list,"nid",$_REQUEST['ai_nid']);

	$res = do_query($sql);

	if($res){
		echo '<script type="text/javascript">alert("修改成功");window.location.href="app_info.php?nav-itemed=wechat";</script>';
	}
	else{
        echo '<script type="text/javascript">alert("修改失败");window.location.href="app_info.php?nav-itemed=wechat";</script>';
    }

}


?>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <?php include ROOT_PATH_.'/controller/common/modules/head.php'; ?>
</head>

<body>


<div id="topbar">
    <?php include ROOT_PATH_.'/controller/common/modules/topbar.php'; ?>
</div>

<div id="container" class="<? echo $system_part ?>">

    <div id="maincontent">

        <div id="sidebar">
            <?php include ROOT_PATH_.'/controller/common/modules/sidebar.php'; ?>
        </div>


		<div id="content" class="layui-form">
            <?php $page_title='小程序详情';?>
            <?php include ROOT_PATH_.'/controller/common/modules/mod-page-title.php'; ?>

			<div class="detail-box member-edit-box layui-form">

                <div class="detail-boxes">
					<div class="detail-boxing">

					<form id="edit-member-form" method="post" action="app_info.php?act=update" class="layui-form">
 						  <input type="hidden" name="ai_nid" value="<? echo $detail['nid']?>">

                          <div class="layui-form-item">
                            <label class="layui-form-label">小程序appid</label>
                            <div class="layui-input-block">
                              <input type="text" name="ai_wxapp_id" required  lay-verify="required" placeholder="请输入小程序appid" autocomplete="off" class="layui-input" value="<? echo $detail['wxapp_id']?>">
                            </div>
                          </div>
                          <div class="layui-form-item">
                            <label class="layui-form-label">小程序appsecret</label>
                            <div class="layui-input-block">
                              <input type="text" name="ai_wxapp_secret"  placeholder="请输入小程序appsecret" autocomplete="off" class="layui-input" value="<? echo $detail['wxapp_secret']?>">
                            </div>
                          </div>
                          <div class="layui-form-item">
                            <label class="layui-form-label">微信商户号</label>
                            <div class="layui-input-block">
                              <input type="text" name="ai_mchid" required  lay-verify="required" placeholder="请输入微信商户号" autocomplete="off" class="layui-input" value="<? echo $detail['mchid']?>">
                            </div>
                          </div>
                          <div class="layui-form-item">
                            <label class="layui-form-label">微信支付密钥</label>
                            <div class="layui-input-block">
                              <input type="text" name="ai_apikey" required  lay-verify="required" placeholder="请输入微信支付密钥" autocomplete="off" class="layui-input" value="<? echo $detail['apikey']?>">
                            </div>
                          </div>
                          <div class="layui-form-item">
                            <label class="layui-form-label">证书文件cert</label>
                              <div class="layui-input-block">

                                  <textarea name="ai_cert_pem" placeholder="请输入证书文件cert" class="layui-textarea"><? echo $detail['cert_pem']?></textarea>
                              </div>
                          </div>
                          <div class="layui-form-item">
                            <label class="layui-form-label">证书文件key</label>
                              <div class="layui-input-block">

                                  <textarea name="ai_key_pem" placeholder="请输入证书文件key" class="layui-textarea"><? echo $detail['key_pem']?></textarea>

                              </div>
                          </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">微信V3 KEY</label>
                            <div class="layui-input-block">
                                <input type="text" name="ai_v3key"  placeholder="请输入微信V3 KEY" autocomplete="off" class="layui-input" value="<? echo $detail['v3key']?>">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">证书序列号</label>
                            <div class="layui-input-block">
                                <input type="text" name="ai_serial_no"   placeholder="请输入证书序列号" autocomplete="off" class="layui-input" value="<? echo $detail['serial_no']?>">
                            </div>
                        </div>


                          <div class="layui-form-item">
                            <div class="layui-input-block">
                              <button class="layui-btn" lay-submit lay-filter="formMemberAdd" type="submit">立即提交</button>
                              <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                            </div>
                          </div>

					</form>
					</div>
				</div>
			</div>

<!--content端點01-->
</div>
<!--maincontent端點01-->
<br class="clearfloat"/>
</div>
<!--container端點01-->
</div>

<?php include ROOT_PATH_ . "/controller/common/modules/footer.php"; ?> </body>
</body>
</html>
